<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<s:if test="#session.user == null">
	<script type="text/javascript">
alert("您还未登录！无法发帖！");
open("index", "_self");
</script>
</s:if>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=x-gbk">
		<title>发表帖子 - 10ACCP2班级论坛 - Powered by 19#417</title>
		<link rel="stylesheet" type="text/css" href="css/style_1_common.css">
		<link rel="stylesheet" type="text/css"
			href="css/style_1_forum_post.css">
		<link rel="stylesheet" id="css_extstyle" type="text/css"
			href="css/style.css">
		<script type="text/javascript" src="ckeditor/ckeditor.js">
</script>
		<script type="text/javascript">
function setHomePages() {
	document.documentElement.style.behavior = "url(#default#homepage)";
	document.documentElement.setHomePage('http://localhost:8080/Accp_BBS');

}
function addCookie() {
	if (document.all) {
		window.external.addFavorite('http://localhost:8080/Accp_BBS',
				'10ACCP2班级论坛');
	} else if (window.sidebar) {
		window.sidebar.addPanel('10ACCP2班级论坛',
				'http://localhost:8080/Accp_BBS', '');
	}
}
</script>
	</head>


	<body id="nv_forum" class="pg_post"
		onkeydown="if(event.keyCode==27) return false;">
		<div id="ajaxwaitid"></div>
		<div id="toptb" class="cl">
			<div class="wp">
				<div class="z">
					<a href="javascript:setHomePages()">设为首页</a><a
						href="javascript:addCookie()">收藏本站</a>
					<script type="text/javascript">
var _speedMark = new Date();
</script>
				</div>
			</div>
		</div>
		<div id="hd">
			<div class="wp">
				<div class="hdc cl">
					<h2>
						<a href="index" title="10ACCP2论坛"><img src="images/ACCP2.png"
								alt="10ACCP2论坛" border="0">
						</a>
					</h2>
					<%@ include file="user.jsp"%>
				</div>
				<div id="nv">
					<ul>
						<li class="a" id="mn_forum">
							<a href="index" hidefocus="true" title="BBS">论坛<span>BBS</span>
							</a>
						</li>
						<li id="mn_N12a7">
							<a href="index" hidefocus="true" title="Ranklist">班级<span>Class</span>
							</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div id="wp" class="wp">
			<div id="pt" class="bm cl">
				<div class="z">
					<a href="#" class="nvhm" title="首页">10ACCP2论坛</a>
					<em>&#8250;</em>
					<a href="index">10ACCP2论坛>></a>
					<em>&#8250;</em>
					<a href="topic-List">〓<s:property
							value="#session.section.sname" />频道〓>></a><em>&#8250;</em>
					<a href="topic-Add"> 发表帖子</a>
				</div>
			</div>
			<form method="post" autocomplete="off" id="postform"
				action="topic-Add?topic.tsid=<s:property value="#parameters.sid"/>"
				onsubmit="return validate(this)">
				<div id="ct" class="ct2_a ct2_a_r wp cl">
					<div class="mn">
						<div class="bm bw0 cl" id="editorbox">
							<ul class="tb cl mbw">
								<li class="a">
									<a href="topic-Add"
										onclick="switchpost('forum.php?mod=post&amp;action=newthread')">发表帖子</a>
								</li>
							</ul>
							<div id="postbox">
								<div class="pbt cl">
									<div class="ftid">
										<h3>
											标题：
										</h3>
										&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									</div>
									<div class="z">
										<span> <input name="topic.ttopic" id="topic.ttopic"
												class="px"
												onblur="if($('tags')){relatekw('-1','-1');doane();}"
												onkeyup="strLenCalc(this, 'checklen', 80);"
												style="width: 25em;" tabindex="1" type="text"> </span>
										<span id="subjectchk">还可输入 <strong id="checklen">80</strong>
											个字符</span>
									</div>
								</div>
								<div class="area">

									<textarea class="ckeditor" cols="80" id="content"
										name="topic.tcontents" rows="10">   
									</textarea>
									<script type="text/javascript">

CKEDITOR.replace('content', {
	height : 600
}, addUploadButton(this));
function addUploadButton(editor) {
	CKEDITOR.on('dialogDefinition', function(ev) {

		var dialogName = ev.data.name;

		var dialogDefinition = ev.data.definition;

		if (dialogName == 'image') {

			var infoTab = dialogDefinition.getContents('info');

			infoTab.add( {

				type : 'button',

				id : 'upload_image',

				align : 'center',

				label : '上传',

				onClick : function(evt) {

					var thisDialog = this.getDialog();

					var txtUrlObj = thisDialog.getContentElement('info',
							'txtUrl');

					var txtUrlId = txtUrlObj.getInputElement().$.id;

					addUploadImage(txtUrlId);

				}

			}, 'browse'); //place front of the browser button

		}

	});

}

function addUploadImage(theURLElementId) {

	var uploadUrl = "uploadImg.jsp"; //这是我自己的处理文件/图片上传的页面URL

	var imgUrl = window.showModalDialog(uploadUrl);

	//在upload结束后通过js代码window.returnValue=...可以将图片url返回给imgUrl变量。

	//更多window.showModalDialog的使用方法参考 

	var urlObj = document.getElementById(theURLElementId);

	urlObj.value = imgUrl;

	urlObj.fireEvent("onchange"); //触发url文本框的onchange事件，以便预览图片

}
</script>

								</div>
								<div style="height: 20px;"></div>
								<!-- 空一段,美观 -->
								<button type="submit" id="postsubmit" class="pn pnc"
									value="true" name="topicsubmit">
									<span>发表帖子</span>
								</button>
							</div>
						</div>
					</div>
				</div>
		</div>
		</form>
		</div>
		<div id="ft" class="wp cl">
			<div id="flk" class="y">
				<p>
					<strong><a href="#" target="_blank">10ACCP2论坛</a> </strong>
					&nbsp;&nbsp;
					<span id="tcss"></span>
				</p>
				<p class="xs0">
					19#417 &nbsp;&nbsp;版权所有 &nbsp;&nbsp;
					<span id="tcss"></span>
					</span>
				</p>
			</div>
			<div id="frt">
				<p>
					Powered by
					<strong><a href="#" target="_blank">19#417</a> </strong>
				</p>
				<p class="xs0">
					&#169; 2011-2012
					<a href="#" target="_blank">10ACCP2</a>
				</p>
			</div>
		</div>
		<div style="position: absolute; display: none; z-index: 9999;"
			id="livemargins_control">
			<img src="images/monitor-background-horizontal.png"
				style="position: absolute; left: -77px; top: -5px;" height="5"
				width="77">
			<img src="images/monitor-background-vertical.png"
				style="position: absolute; left: 0pt; top: -5px;">
			<img id="monitor-play-button" src=a
				"images/monitor-play-button.png" onmouseover="this.style.opacity=1"
				onmouseout="this.style.opacity=0.5"
				style="position: absolute; left: 1px; top: 0pt; opacity: 0.5; cursor: pointer;">
		</div>
	</body>
</html>
